package jnpf.engine.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @description:
 * @author: duanxu
 * @create: 2025-02-14 14:53
 **/
@Getter
@AllArgsConstructor
public enum FlowSelectorEnums {

    USER("user", null),
    GROUP("group", FlowUserRelationTypeEnums.GROUP),
    POSITION("position", FlowUserRelationTypeEnums.POSITION),
    ROLE("role", FlowUserRelationTypeEnums.ROLE),
    DEPARTMENT("department", FlowUserRelationTypeEnums.ORGANIZE),
    ;

    private String value;
    private FlowUserRelationTypeEnums userRelationType;

    public static FlowSelectorEnums getEnum(String value) {
        for (FlowSelectorEnums type : FlowSelectorEnums.values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        return null;
    }
}
